<script th:fragment="businessJs">
    function saveMenu(){
        formSubmit('/eng/bom/addBom','/eng/bom/index');
    }
    function saveChildBom(){
    	formSubmit('/eng/bom/addChildBom');
    	$('#myModal').modal('hide');
    	toastr.success("提示!","成功！"); 
    }
    //返回到主页
    function backToIndex(){
       window.location.href='/eng/bom/index';
    }
  	//删除行操作 
    function deleteChildRow(){
    	//获取当前选中行的 id 
    	var ids = jQuery("#childgrid").jqGrid("getGridParam", "selrow");
    	if(ids==null || ids==""){
    		toastr.error("你未选择父类，请选择父件！","提示!");  
    		return;
    	}else{
    		//调用ajax 封装    ajaxPostRequest(a,b,c) a:post提交的Url  b:成功或者失败后跳转的地址 c:参数
    	    ajaxPostRequestNoJump('/eng/bom/deleteMaterial',{id:ids});
    	}
    	//删除成功后刷新网格
	    $("#childgrid").jqGrid().trigger("reloadGrid");
  	}
</script>